﻿package com.wxsoft.business.physic.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.wxsoft.business.model.easyui.PageHelper;

import com.wxsoft.business.physic.dao.IPsPhysicPriceModifyHeadDao;
import com.wxsoft.business.physic.service.IPsPhysicPriceModifyHeadService;
import com.wxsoft.business.physic.pojo.PsPhysicPriceModifyHead;

@Service("psPhysicPriceModifyHeadService")
public class PsPhysicPriceModifyHeadServiceImpl implements IPsPhysicPriceModifyHeadService  {
	@Resource
	private IPsPhysicPriceModifyHeadDao dao;
	
	
	public long findCount(PsPhysicPriceModifyHead psPhysicPriceModifyHead) {
		return dao.findCount(psPhysicPriceModifyHead);
	}
	
	public List<PsPhysicPriceModifyHead> findAll(PageHelper page,PsPhysicPriceModifyHead psPhysicPriceModifyHead) {
        List<PsPhysicPriceModifyHead> r = dao.findAll(page,psPhysicPriceModifyHead);
		return r;
	}
	@Transactional
	public String add(PsPhysicPriceModifyHead psPhysicPriceModifyHead) {
		
		psPhysicPriceModifyHead.setAccount_sign("no");
		
		int r = this.dao.insert(psPhysicPriceModifyHead);
		if(r==1){
			return "操作成功!";
		}
		return "操作失败!";
	}
	@Transactional
	public String modify(PsPhysicPriceModifyHead psPhysicPriceModifyHead) {
		int r = this.dao.modify(psPhysicPriceModifyHead);
		if(r==1){
			return "操作成功!";
		}
		return "操作失败!";
	}
	@Transactional
	public String delete(PsPhysicPriceModifyHead psPhysicPriceModifyHead) {
		int r = this.dao.delete(psPhysicPriceModifyHead);
		if(r==1){
			return "操作成功!";
		}
		return "操作失败!";
	}
	
}
